<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="js/jquery.1.10.2.js"></script>
</head>
<body>
<style>
    .box, span {
        display: flex;
    }

    span {
        cursor: pointer;
    }
</style>
<div class="box">
    <div class="centent">
        <select multiple name="" id="select1" style="width: 100px;height: 160px;">
            <option value="1">选项1</option>
            <option value="2">选项2</option>
            <option value="3">选项3</option>
            <option value="4">选项4</option>
            <option value="5">选项5</option>
            <option value="6">选项6</option>
            <option value="7">选项7</option>
        </select>

        <div>
            <span id="add">选中添加到右边&gt;</span>
            <span id="addAll">全部添加到右边&gt;</span>
        </div>
    </div>
    <div class="centent">
        <select multiple id="select2" style="width: 100px;height: 100px;"></select>

        <div>
            <span id="remove">&lt;选中删除到左边</span>
            <span id="removeAll">&lt;全部删除到左边</span>
        </div>
    </div>
</div>
<script>
    $(function(){
        //添加选中的值
        $('#add').click(function(){
            var select=$('#select1 option:checked')
            $('#select2').append(select)
        })
        //选中所有的
        $('#addAll').click(function(){
            var all=$('#select1 option')
           $('#select2').append(all)
        })
        //删除选中的
        $('#remove').click(function(){
            var selected=$('#select2 option:checked')
            $('#select1').append(selected)
        })
        //全部删除
        $('#removeAll').click(function(){
            var selectAll=$('#select2 option')
            $('#select1').append(selectAll)
        })
        //双击某个添加到右侧
        $('#select1').dblclick(function(){
            var options=$('option:selected',this)
            $('#select2').append(options)
        })
    })
</script>
</body>
</html>